package com.itcanteen.reggie.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.itcanteen.reggie.dto.DishDto;
import com.itcanteen.reggie.entity.Dish;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author baimugudu
 * @email 2415621370@qq.com
 * @date 2022/10/25 16:21
 */

@Mapper
public interface DishDao extends BaseMapper<Dish> {
    void updateDish(DishDto dishDto);


    //根据id查找菜品
    @Select("select * from dish where id=#{id}")
    Dish findById(Long id);

    public List<DishDto> findAll(@Param("pageInfo") Page<DishDto> pageInfo, @Param("name") String name);
}
